# -*- coding: utf-8 -*-

class An():
	def define(self):
		print ('都有四条腿')
		pass

#继承
class Dog(An):
	"""docstring for Dog"""
	def __init__(self):
		super(Dog, self).__init__()
		pass

class Duck():
	"""docstring for Duck"""
	def __init__(self):
		super(Duck, self).__init__()

		
dog = Dog();
dog.define();

an = An();

#判断对象和类是否有父子关系
print(isinstance(dog,An))

#判断对象和类是否有父子关系
print(isinstance(dog,Dog))

#判断对象和类是否有父子关系
print(isinstance(dog,Duck))

#type 判断一个对象是什么类型
print (type('abc'));

print (type('abc')=='str');

#isinstance  str int list  tuple dict;
print( isinstance('a',str) , isinstance(1,int),isinstance(['a'],list),isinstance({'a':22},dict));

#小写
print('ABC'.lower(),'abc'.upper());

# dir() 获取一个对象中有哪些方法和属性
print(dir('abc'))
